from bs4 import BeautifulSoup
from urllib import request
from bs4 import UnicodeDammit

from io import BytesIO
import gzip

# 起点中文网，https://www.qidian.com/

# 分析数据的来源

url = "https://www.qidian.com/all/action1/"

try:
    headers = {"User-Agent": "Mozilla/5.0 (Windows; U; Windows NT 6.0 x64; en-US; rv:1.9pre) Gecko/2008072421 Minefield/3.0.2pre" }
    req = request.Request(url=url,headers=headers)
    data = request.urlopen(req)
    data = data.read()

    # print(data.decode())
    soup = BeautifulSoup(data, "lxml")
    ul = soup.find_all("ul", attrs={"class": "all-img-list cf"})
    print(ul)

 
except Exception as err:
    print(err)